package com.itheima.controller;

import com.itheima.pojo.Question;
import com.itheima.service.QuestionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: liangWeiQUQ
 * @Description: 查询
 * @DateTime: 2021/3/28 17:49
 **/
@RestController
@Api(tags = "问题搜索Controller")
@RequestMapping("/system")
public class SearchController {
    @Autowired
    private QuestionService questionService;

    @PostMapping("/answer")
    @ApiOperation("搜索问题的接口")
    public List<Question> findByAnswer(@RequestBody String title) {
        return  questionService.findByAnswer(title);

    }
}
